﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ExtAspNet;

namespace HY.WEB.PQ
{
    public partial class mem_view : PageBase
    {
        public string us, whe = "", path = "";
        public string tab = "pq_member";
        protected void Page_Load(object sender, EventArgs e)
        {
            us = Session["ID"].ToString();
            if (!IsPostBack)
            {
                if (!String.IsNullOrEmpty(Request["sid"]))
                {
                     hidsid.Text = Request["sid"].Trim();                
                }
             
                fill2();
            }

        
        }

        public string getcompany(string sbh)
        {
            string sval = "";
            sval = BLL.BLLfun.get_company(sbh);
            return sval;
        }

        void fill2()
        {
            string dts; DateTime lastday;

            BLL.PQ.pq_member S = new BLL.PQ.pq_member();
         // DataTable d=  S.GetList("sid="+hidsid.Text).Tables[0];
          DataTable d = BLL.Bllbase.get_table(tab, "sid=" + hidsid.Text);// S.GetList("sid=" + hidsid.Text).Tables[0];

        
          hidsbh.Text = d.Rows[0]["sbh"].ToString().Trim();
          txtnm.Text = d.Rows[0]["user_name"].ToString().Trim();
          lblcompany.Text = getcompany(hidsbh.Text.Trim());
           
      
          ddlsex.Text = d.Rows[0]["sex"].ToString();

          txtschool.Text = d.Rows[0]["school"].ToString().Trim();

          ddledu.Text = d.Rows[0]["sex"].ToString();

          major.Text = d.Rows[0]["major"].ToString().Trim();

          ddldetp.Text =d.Rows[0]["dept"].ToString();

          ddlrole.Text = d.Rows[0]["role"].ToString();

          lblowen.Text = d.Rows[0]["owen"].ToString();

          txtjg.Text = d.Rows[0]["jg"].ToString().Trim();
          txtaddress.Text = d.Rows[0]["hj_address"].ToString().Trim();
          txtnewadd.Text = d.Rows[0]["cur_address"].ToString().Trim();
          txtcode.Text = d.Rows[0]["code"].ToString().Trim();
          txttel.Text = d.Rows[0]["tel"].ToString().Trim();
          txtjustperson.Text = d.Rows[0]["r_name"].ToString().Trim();
          txtjusttel.Text = d.Rows[0]["r_tel"].ToString().Trim();
          txtqq.Text = d.Rows[0]["qq"].ToString().Trim();
          txtemail.Text = d.Rows[0]["email"].ToString().Trim();
          ddlmarry.Text = d.Rows[0]["marry"].ToString().Trim();

           string rdate = d.Rows[0]["birthday"].ToString().Trim();
            if (rdate.Substring(0, 4) != "1900")
            {
                 lastday = DateTime.Parse(rdate);
                 birthday.Text = lastday.ToString("yyyy-M-d");
            }

           dts = d.Rows[0]["indate"].ToString().Trim();
          if (dts.Substring(0, 4) != "1900")
          {
               lastday = DateTime.Parse(dts);
                indate.Text = lastday.ToString("yyyy-M-d");
          }

           dts = d.Rows[0]["outdate"].ToString().Trim();
          if (dts.Substring(0, 4) != "1900")
          {
               lastday = DateTime.Parse(dts);
              outdate.Text = lastday.ToString("yyyy-M-d");
          }

          txtlgid.Text = d.Rows[0]["lgid"].ToString().Trim();
          txtlgpw.Text = d.Rows[0]["lgpw"].ToString().Trim();

          ddlstatus.Text =d.Rows[0]["status"].ToString();

          ddlinout.Text = d.Rows[0]["inout"].ToString();
          Image1.ImageUrl = d.Rows[0]["pic"].ToString();
        }
  
      

       
       
    }
}